﻿using SanJ.FreeCare.TypeFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;

namespace SanJ.FreeCare.Transports
{
    public class Transport : AuditedAggregateRoot<Guid>
    {
        /// <summary>
        /// Identifier(s) by which this encounter is known
        /// </summary>
        public List<Identifier> Identifier { get; private set; }

        /// <summary>
        /// 第三方ID
        /// </summary>
        public string ThirdId { get; private set; }

        /// <summary>
        /// 转运定义名称ActivityDefinition)
        /// </summary>
        public Guid? InstantiatesCanonicalId {  get; private set; }

        /// <summary>
        /// 组合编码
        /// </summary>
        public string GroupCode { get; private set; }

        /// <summary>
        /// 树结构编码
        /// </summary>
        public string TreeCode { get; private set; }
        /// <summary>
        /// 转运状态
        /// 	in-progress | completed | abandoned | cancelled | planned | entered-in-error
        /// </summary>
        public string StatusCode {  get; private set; }

        /// <summary>
        /// 当前状态的原因
        /// </summary>
        public string StatusReasonCode {  get; private set; }

        /// <summary>
        /// 	unknown | proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
        /// </summary>
        public string IntentCode {  get; private set; }

        /// <summary>
        /// routine | urgent | asap | stat
        /// </summary>
        public string PriorityCode {  get; private set; }

        /// <summary>
        /// 关于这次运输的描述
        /// </summary>
        public string Description {  get; private set; }

        /// <summary>
        /// 转运的实体类型
        /// </summary>
        public string FocusType { get; private set; }

        /// <summary>
        /// 转运的实体Id
        /// </summary>
        public Guid? FocusId { get; private set; }

        /// <summary>
        /// 转运原因实体类型
        /// </summary>
        public string ForType { get; private set; } 

        /// <summary>
        /// 转运原因ID 
        /// </summary>
        public Guid? ForId { get; private set; }

        /// <summary>
        /// 就诊ID
        /// </summary>
        public Guid? EncounterId {  get; private set; }

        /// <summary>
        /// 运输完成时间
        /// </summary>
        public DateTime CompletionTime { get; private set; }

        /// <summary>
        /// 请求运输实体类型
        /// </summary>
        public string RequesterType { get; private set; }
        /// <summary>
        /// 请求运输实体id
        /// </summary>
        public Guid? RequesterId { get; private set; }
        /// <summary>
        /// 执行人类型
        /// </summary>
        public string PerformerTypeCode { get; private set; }
        /// <summary>
        /// 负责人
        /// </summary>
        public string OwnerType {  get; private set; }
        /// <summary>
        /// 责任人ID
        /// </summary>
        public Guid? OwnerId {  get; private set; }
        /// <summary>
        /// 发生转运的位置
        /// </summary>
        public Guid? LocationId {  get; private set; }

        /// <summary>
        /// 转运限制条件，比如限制谁接收，什么时候接收
        /// </summary>
        public TransportRestriction[] TransportRestriction {  get; private set; }

        /// <summary>
        /// 转运开始前录入的信息
        /// </summary>
        public TransportInput[] TransportInput { get; private set; }

        /// <summary>
        /// 转运过程中产生的信息
        /// </summary>
        public TransportOutput[] TransportOutput { get; private set; }

        /// <summary>
        /// 目的地
        /// </summary>
        public Guid RequestedLocationId { get; private set; }

        /// <summary>
        /// 当前位置
        /// </summary>
        public Guid RcurrentLocationId { get; private set; }

        /// <summary>
        /// 备注/Comments made about the transport
        /// </summary>
        public string Note { get; private set; }

        public Transport()
        {
            
        }
        public Transport(List<Identifier> identifier, string thirdId, Guid? instantiatesCanonicalId, string groupCode, string treeCode, string statusCode, string statusReasonCode, string intentCode, string priorityCode, string description, string focusType, Guid? focusId, string forType, Guid? forId, Guid? encounterId, DateTime completionTime, string requesterType, Guid? requesterId, string performerTypeCode, string ownerType, Guid? ownerId, Guid? locationId, TransportRestriction[] transportRestriction, TransportInput[] transportInput, TransportOutput[] transportOutput, Guid requestedLocationId, Guid rcurrentLocationId, string note)
        {
            Identifier = identifier;
            ThirdId = thirdId;
            InstantiatesCanonicalId = instantiatesCanonicalId;
            GroupCode = groupCode;
            TreeCode = treeCode;
            StatusCode = statusCode;
            StatusReasonCode = statusReasonCode;
            IntentCode = intentCode;
            PriorityCode = priorityCode;
            Description = description;
            FocusType = focusType;
            FocusId = focusId;
            ForType = forType;
            ForId = forId;
            EncounterId = encounterId;
            CompletionTime = completionTime;
            RequesterType = requesterType;
            RequesterId = requesterId;
            PerformerTypeCode = performerTypeCode;
            OwnerType = ownerType;
            OwnerId = ownerId;
            LocationId = locationId;
            TransportRestriction = transportRestriction;
            TransportInput = transportInput;
            TransportOutput = transportOutput;
            RequestedLocationId = requestedLocationId;
            RcurrentLocationId = rcurrentLocationId;
            Note = note;
        }

    }
}
